
<!DOCTYPE html>
<html>
    <head>
        <title>Moon Silver</title>
        <meta charset="UTF-8"> 
        <link rel="stylesheet" type="text/css" href="css/footerStyle.css"/>
        <link rel="stylesheet" type="text/css" href="css/headerStyle.css"/>
        <link rel="stylesheet" type="text/css" href="css/mainStyle.css"/>
        <link rel="stylesheet" type="text/css" href="css/Chart.css"/>
        
        <!--<script type="text/javascript" src="Scripts/DolphJS.js"></script>-->
        <script type="text/javascript" src="Scripts/jquery-1.8.1.min.js"></script>
        <script type="text/javascript" src="Scripts/AJAX.js"></script>
        <script type="text/javascript" src="Scripts/GoogleScript.js"></script> 
        <script type="text/javascript" src="Scripts/Chart.js"></script>
        
    </head>
    <body>
        
        <header>
        <div id="backgroundBanner">
            <div id="bannerContent">
                <div id="logo">
                    <a href="index.php"><img src='img/logo.png'></a>
                </div><!--end logo wrap-->
                <div id="navigation"> 
                    <?php
                        include ('navigation.php');
                    ?>
                </div><!--end navigation wrap--> 
                <!-- <div id="slideshow">
                    <?php
                        //include ('slideshow.php');
                    ?> 
                </div> -->
            </div>
            
            <div id="newsContent">
                <h2>Tin tức</h2>
                <div id="blockA-News">
                    <div id="menuNewsContent">
                        <?php 
                         include "DB.php";
                         $result = mysql_query("SELECT * FROM newstype");
                         while ($row = mysql_fetch_row($result))
                         {
                             $id = $row[0];
                             $type = $row[1];
                             echo "<span onclick = 'Index_ChooseType($id)'>$type</span>";
                         }
                        ?>
                    </div>
                    <div id="DisplayNews">  
                    <?php 
                    $result2 = mysql_query("SELECT title,time,id FROM NEWS GROUP BY ID DESC LIMIT 0,6 ");
                    while ( $row = mysql_fetch_row($result2))
                    {
                        $i = 50;
                        $title = $row[0];
                        $id = $row[2];
                        $length = strlen($title);
                        $showTitle = substr($title,0, $i - intval($length));
                        while (substr($showTitle, -1) != ' ')
                        {
                            $i = $i - 1;
                            $showTitle = substr($title,0, $i - intval($length));
                        }
                        $showTitle = $showTitle.'...';
                        $time = date("d/m",strtotime($row[1]));
                        if ($length >= $i) {
                            echo "<a class='btn' title='$title' href='javascript: Index_ChooseNews($id);' >$showTitle  ($time)</a>";
                        }
                        else {
                            echo "<a class='btn' title='$title' href='javascript: Index_ChooseNews($id);' >$title  ($time)</a>"; 
                        }
                    }
                    ?>
                    </div>   
                </div>
                <div id="blockB-News">                
                    
                    <?php
                       
                        $result1 = mysql_query("SELECT title,description,image,time,ID FROM news ORDER BY ID DESC LIMIT 0,1");
                        while ($row = mysql_fetch_row($result1))
                        {
                            $title1 = $row[0];
                            $des1 = $row[1];
                            $image1 = $row[2];
                            //$time1 = date("(j/n)",strtotime($row[3]));
                            $date1 = date("d/m/Y",strtotime($row[3]));
                            $hour = date("H:i",strtotime($row[3]));
                            //$id1 = $row[4];
                            echo "  <div id='titleNews'><h3>$title1</h3> </div>
                                
                                    <div id='ImgDisplay'>
                                        <img id='newsImg' src='$image1' alt='IMG'></div>";                                    
                        }       
                    ?>                  
                    
                    <div id="contentNews">
                        <span><?php echo $hour." - ".$date1 ?></span><br>
                        <?php echo $des1 ?>                        
                        <a id="ViewDetail" class="linkViewDetail"> >> Chi tiết</a>
                    </div> 
                    <a id="SeeMore" class="btnSeeMore">Xem thêm</a>
                </div>
                
            </div>
        </div>
        </header>
        <!-- -->
        <div id="contentBackground">
        </div>
        
        <div id="chartContent">
            <div id="price_SilverMoon">
                <div id="buyPrice" class="price">
                    GIÁ MUA <div class="priceDetail">900.000 VNĐ</div>
                </div>
                <div id="sellPrice" class="price">
                    GIÁ BÁN <div class="priceDetail">950.000 VNĐ</div>
                </div>
            </div>
            Diễn biến giá bạc mặt trăng
            <div id="chartHeader">
                <?php 
                    $now = time();
                    $today = date('d/m/Y', mktime(0, 0, 0, date("m", $now), date("d", $now), date("Y", $now)));
                    echo "Ngày $today từ 00:00 đến 23:59";
                ?>
            </div>
            <div id="chart_div">
                
                <div id="loadingImg" class="visible">
                    <img src="img/loading.gif" width="50px"/>
                    <br/>..... đang xử lý .....          
               </div>
            </div>
            <div id="loadingImg" class="visible">
                    <img src="img/loading.gif" width="50px"/>
                    <br/>..... đang xử lý .....          
               </div>
            <div id="btnSeeChart">
                    <a id="SeeChart1Day" href="javascript: drawDayChart(); showDayHeader();">Biểu đồ theo ngày</a>
                    <a id="SeeChart7Days" href="javascript: drawWeekChart(); showWeekHeader();">Biểu đồ 7 ngày</a>
                    <a id="SeeChart30Days" href="javascript: drawMonthChart(); showMonthHeader();">Biểu đồ 30 ngày</a>
            </div>
            <div id="ChartKitco">
                <div id="TitleChart">Biểu đồ giá bạc Thế giới</div>
                <div id="MonthChart">
                    <a onclick="javascript:window.open('http://www.kitco.com/charts/popup/ag0030lnb.html','30daysilverchart','location=1,status=1,scrollbars=1,width=500,height=500')" style="cursor:pointer">
                            <img src="http://www.kitconet.com/charts/metals/silver/ag_go_0030_ny.gif" />
                    </a>
                </div>

                <div id="YearChart">                
                    <a onclick="javascript:window.open('http://www.kitco.com/charts/popup/ag0365nyb.html','30daysilverchart','location=1,status=1,scrollbars=1,width=500,height=500')" style="cursor:pointer">
                        <img src="http://www.kitconet.com/charts/metals/silver/ag_go_0365_ny.gif" />
                    </a>
                </div>
            </div>
            
            <div id="PriceInfor">
                <!--<iframe  src="http://www.kitcosilver.com/" scrolling="no"></iframe>-->
            </div>
            
        </div>
            <div></div>
        <div id="newsBackground">
            <div id="subContent">
               
            </div>

            <div id="contactContent">
                <?php
                        include ('socialcontact.php');
                ?>
            </div>

            <div id="subscribeContent">
                
                <div id="signup">
                    <!--<iframe  
                            src="https://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=vi&amp;geocode=&amp;q=L%E1%BA%A7u+8,+s%E1%BB%91+58+Nguy%E1%BB%85n+%C4%90%C3%ACnh+Chi%E1%BB%83u,+Ph%C6%B0%E1%BB%9Dng+%C4%90akao,+Qu%E1%BA%ADn+1,+Tp.HCM&amp;aq=&amp;sll=10.784787,106.701322&amp;sspn=0.023903,0.042272&amp;ie=UTF8&amp;hq=L%E1%BA%A7u+8,+s%E1%BB%91+58+Nguy%E1%BB%85n+%C4%90%C3%ACnh+Chi%E1%BB%83u,+Ph%C6%B0%E1%BB%9Dng+%C4%90akao,+Qu%E1%BA%ADn+1,&amp;hnear=H%E1%BB%93+Ch%C3%AD+Minh,+Vi%E1%BB%87t+Nam&amp;t=m&amp;cid=6052308869385949505&amp;ll=10.789529,106.700613&amp;spn=0.007377,0.00912&amp;z=16&amp;iwloc=A&amp;output=embed"></iframe>
                    <br />-->
                    <!-- <small><a href="https://maps.google.com/maps?f=q&amp;source=embed&amp;hl=vi&amp;geocode=&amp;q=%C4%90%C6%AF%E1%BB%9CNG+S%E1%BB%90+24A,+B%C3%ACnh+Tr%E1%BB%8B+%C4%90%C3%B4ng+B,+H%E1%BB%93+Ch%C3%AD+Minh,+Vi%E1%BB%87t+Nam&amp;aq=1&amp;oq=24A+&amp;ie=UTF8&amp;hq=&amp;hnear=%C4%90%C6%AF%E1%BB%9CNG+S%E1%BB%90+24A,+B%C3%ACnh+Tr%E1%BB%8B+%C4%90%C3%B4ng+B,+B%C3%ACnh+T%C3%A2n,+H%E1%BB%93+Ch%C3%AD+Minh,+Vi%E1%BB%87t+Nam&amp;t=m&amp;z=14&amp;ll=10.754674,106.611596" style="color:#0000FF;text-align:left">Xem Bản đồ cỡ lớn hơn</a></small> -->
                </div>
                <script type="text/javascript">
                    onload=loadLast;
                </script>
                
                <div id="subscribe">
                    <a>Nhận báo cáo ngành bạc</a>
                    <input type="text" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;" id="txtName" name="txtName" value="Họ và tên" class="inputSub"/><br>
                    <input type="text" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;" name="txtEmail" value="Email" class="inputSub"/><br>
                    <input type="button" name="submit" value="Đăng ký" id="buttonSub" />
                </div>
            </div>
        </div>
        <?php include "footer.php" ?>    
    </body>
</html>
